package com.luoc;

import com.luoc.service.BuilderService;
import com.luoc.service.impl.BuilderServiceImpl;
import com.luoc.service.impl.Director;
import com.luoc.service.impl.SecondBuilderServiceImpl;

/**
 * @Author: luoc
 * @Date: 2019/9/16 14:40
 * 建造者模式
 * 建造者模式(Builder Pattern)：将一个复杂对象的构建与它的表示分离，
 * 使得同样的构建过程可以创建不同的表示。建造者模式是一种对象创建型模式。
 */
public class BuilderPattern {

    public static void main(String[] args) {
        BuilderService builderService = new BuilderServiceImpl();
        BuilderService builderService2 = new SecondBuilderServiceImpl();
        Director director = new Director(builderService);
        director.getProduct();
        Director director1 = new Director(builderService2);
        director1.getProduct();
    }
}
